/*
 @coding  : utf-8
 @Time    : 2023/4/20 12:42
 @Author  : Rumou
 @File    : 统计计算.go
 @Description:
*/

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	fmt.Println("请输入数字，按照空格分隔")
	var input string
	reader := bufio.NewReader(os.Stdin) // 标准输入输出
	input, _ = reader.ReadString('\n')  // 回车结束
	input = strings.TrimSpace(input)    // 去除最后一个空格
	numList := strings.Split(input, " ")
	total := 0
	max := 0
	for _, value := range numList {
		value, _ := strconv.Atoi(value)
		total = total + value
		if value > max {
			max = value
		}
	}
	count := len(numList)
	fmt.Printf("和为%d\n", total)
	fmt.Printf("平均数为%d\n", total/count)
	fmt.Printf("最大值为%d\n", max)
}
